<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>02v-bind</title>
</head>

<body>
    <h2>属性绑定</h2>
    <ul>
        <li>v-bind用于绑定标签的属性值</li>
        <li>v-bind:属性名="属性值"，将标签对应的属性名绑定为传入的属性值</li>
    </ul>
    <h2>v-bind的简写</h2>
    <ul>
        <li>因为v-bind实在是太常用了，所以vue提供了简写</li>
        <li>v-bind简写为:，那么v-bind:href简写为:href</li>
    </ul>
    <main id="app">
        <div><a v-bind:href="baidu.url" v-bind:title="baidu.title">{{baidu.text}}</a></div>
        <div><a v-bind:href="bilibili.url" v-bind:title="bilibili.title">{{bilibili.text}}</a></div>
    </main>
</body>
<script src="../vue.js"></script>
<script>
    let vue = new Vue({
        el: "#app",
        data: {
            baidu: {
                text: "有问题？百度一下",
                url: "https://www.baidu.com",
                title: "百度一下"
            },
            bilibili: {
                text: "想看视频？来B站",
                url: "https://www.bilibili.com",
                title: "干杯"
            }

        },
    })
</script>

</html>